/** * InvocaJS Version: 4.31.1 * Updated: 06/25/2024 * * The information and software code below, * located at http://solutions.invocacdn.com/js/pnapi_integration-4.31.1.min.js, * are confidential and are the sole property of Invoca. * Your application or use of this information in any way is subject to * Invoca's Terms of Service, which are located at * http://www.invoca.com/terms-of-service/. In accordance with those terms, your * use of this information and code may be terminated by Invoca at any time * for any reason. The rights granted to you under those terms are expressly * non-exclusive. You may not sell, assign, sublicense, or otherwise transfer or * agree to transfer all or any portion of those rights without Invoca's * prior written consent. You agree not to copy, republish, frame, download, * transmit, modify, rent, lease, loan, sell, assign, distribute, license, * sublicense, reverse engineer, or create derivative works based on the * information and/or software code on this page except as expressly authorized * in Invoca's Terms of Service. Your use and continued use of this * information and/or code constitute your acceptance of Invoca's Terms of Service. * * Copyright (c) 2024 Invoca (r) */ this.Invoca=function(){"use strict";var Invoca=window.Invoca||{};function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n>>0,a=0,o=t;for(;a0&&void 0!==arguments[0]?arguments[0]:{};return Invoca.PNAPI.getKeys(e).map((function(t){return e[t]}))},Invoca.PNAPI.escapeRegex=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}&;#]/g,"\\$&")};var formatTime=function(e){var t=function(e){return("0"+e).slice(-2)};return"".concat(t(e.getHours()),":").concat(t(e.getMinutes()),":").concat(t(e.getSeconds()))};function sortData(e){var t={};return Object.keys(e).sort().forEach((function(n){void 0!==e[n]&&null!==e[n]&&(t[n]=e[n])})),t}function hasNewData(e,t){var n=sortData(t);return stringifyJSON(sortData(e))!==stringifyJSON(n)}function nodeContains(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}var messagesObject={};function messages(){return messagesObject}function addToClientMessages(e,t){messagesObject[e]=t}function resetClientMessageValue(e){delete messagesObject[e]}function stringifyObjectValues(e){var t={};return forEach(e,(function(e,n){t[e]=n&&"object"===_typeof(n)?stringifyJSON(n):n})),t}Invoca.ClientInfo=Invoca.ClientInfo||function(){function e(){return{url:Invoca.location,referrer:Invoca.referrer}}return{getAll:function(){return Invoca.PNAPI.extend({},e(),Invoca.ClientInfo._disableDeviceDetails?{}:{cores:t(),platform:n(),screenWidth:Invoca.screenWidth||window.screen&&window.screen.width,screenHeight:Invoca.screenHeight||window.screen&&window.screen.height,language:Invoca.language||window.navigator&&(window.navigator.userLanguage||window.navigator.language)})},getPageInfo:e};function t(){return Invoca.navigatorHardwareConcurrency||navigator.hardwareConcurrency}function n(){return Invoca.navigatorPlatform||navigator.platform}}();var requestArgs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Invoca.PNAPI,r=n.version,a=n.currentPageSettings.networkId;return extend({},{network_id:a,js_version:r,tag_id:Invoca.Client.getTagId(),request_data_shared_params:stringifyJSON(stringifyObjectValues(e||{})),client_messages:stringifyJSON(messages()),client_info:stringifyJSON(Invoca.ClientInfo.getAll())},t)};function removeUndefinedValues(e){var t=getKeys(e);return reduce(t,(function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}var ALLOWED_VERSIONS=["2014-09-01"];function requestUrl(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Invoca.PNAPI.currentPageSettings,r=n.networkId,a=n.forceHttps,o=n.dataSilo,i=a?"https:":window.location.protocol,s=document.createElement("a");Invoca.PNAPI.config.URL&&(s.href=Invoca.PNAPI.config.URL),Invoca.PNAPI.config.customHost&&(Invoca.PNAPI.config.customHost=Invoca.PNAPI.config.customHost.replace(/^(https?:)?\/\//,"")),Invoca.PNAPI.config.customPath&&(Invoca.PNAPI.config.customPath=Invoca.PNAPI.config.customPath.replace(/^([^/].*)/,"/$1"));var c=e?"":s.pathname.replace(/^\/$/,""),u=Invoca.PNAPI.config.customHost||s.host||getDefaultHost(o),l=Invoca.PNAPI.config.customPath||c||getDefaultPath(e),d="".concat(i,"//").concat(u).concat(l);return t&&(d=(d=d.replace(/\.jsonp$/i,"_debug.jsonp")).replace(/\.json$/i,"_debug.json")),d=d.replace(/VERSION_KEY/,ALLOWED_VERSIONS[0]).replace(/PARTITION/,(parseInt(r)||0)%16).replace(/NETWORK_ID/,r)}function getDefaultHost(e){return e&&"us"!==e?"pnapi.".concat(e,".invoca.net"):"pnapi.invoca.net"}function getDefaultPath(e){return e?"/NETWORK_ID/na.jsonp":"/PARTITION/api/VERSION_KEY/map_number.jsonp"}var logData=[],logHistory={warningCount:0},MAX_WARNINGS_TO_LOG=100,clearLog=function(){for(var e in logData.length=0,logHistory)delete logHistory[e];logHistory.warningCount=0};Invoca.PNAPI.clearLog=clearLog,Invoca.PNAPI.display=function(){return console.log("\n"),console.log("InvocaJS ".concat(Invoca.PNAPI.version," Logs:")),console.log("-----------------------"),forEach(logData,(function(e){var t="log";if(e.constructor===Object){var n,r=[];e.type&&(t=e.type),e.time&&r.push("".concat(formatTime(e.time),":")),r.push(e.message);var a=logHistory[e.message];a&&a>1&&r.push("(".concat(a," times)")),(n=console)[t].apply(n,r)}else console[t](e)})),console.log("-----------------------"),null};var log=function(e){var t;"undefined"!=typeof console&&void 0!==console.log&&((null===(t=Invoca.PNAPI.currentPageSettings)||void 0===t?void 0:t.debugMode)&&console.log("Invoca ".concat(Invoca.PNAPI.version,":"),e));logData.push({message:e,type:"log",time:new Date})};Invoca.PNAPI.log=function(e){warn("Invoca.PNAPI.log is deprecated and will be removed in a future version. Please use console.log instead."),log(e)};var logOnce=function(e){logHistory[e]?logHistory[e]+=1:(logHistory[e]=1,log(e))};Invoca.PNAPI.logOnce=logOnce;var warn=function(e){"undefined"!=typeof console&&void 0!==console.warn&&(logHistory.warningCount>=MAX_WARNINGS_TO_LOG&&!logHistory.warningCountReached?(logHistory.warningCountReached=!0,console.warn("Invoca: max warnings have been reached. Use 'Invoca.PNAPI.display()' to view full debug logging.")):logHistory.warningCount0?stringifyJSON(o):void 0});return t.isComplete()&&(metricsInstance.roundTripDataHasBeenSent=!0),resetClientMessageValue("allDataReset"),removeUndefinedValues(i)}function onResponse(e,t,n){log("Invoca.PNAPI.requestPromoNumbers onResponse triggered. Response data below:"),log(e),n.resetRequestData();var r=t.batchId||(new Date).getTime(),a=find(e,(function(e){return"settings"===e.type}));metricsInstance.roundTripDataIsWanted=(a||{}).metrics,t.context?t.onComplete.apply(t.context,[r,e]):t.onComplete(r,e)}function requestPromoNumbers(e,t){var n=Invoca.PNAPI.currentPageSettings.ssa;if("function"==typeof e.onComplete)if(Invoca.PNAPI.currentPageSettings.networkId){var r=requestUrl(n),a=jsonArgsThatExist(e,t);Invoca.PNAPI.requestWithData(r,a,n,t,(function(n){return onResponse(n,e,t)}))}else Invoca.log("ERROR: networkId must be set before calling Invoca.PNAPI.requestPromoNumbers",!0);else Invoca.log("Invoca.PNAPI.requestPromoNumbers: onComplete callback is required",!0)}Invoca.PNAPI.warn=function(e){warn("Invoca.PNAPI.warn is deprecated and will be removed in a future version. Please use console.warn instead."),warn(e)},Invoca.PNAPI=extend({},Invoca.PNAPI,{ALLOWED_VERSIONS:ALLOWED_VERSIONS,requestPromoNumbers:requestPromoNumbers}),Invoca.PNAPI.pendingRequests=Invoca.PNAPI.pendingRequests||[];var addRequest=function(e){find(Invoca.PNAPI.pendingRequests,(function(t){return t===e}))||Invoca.PNAPI.pendingRequests.push(e)},removeRequest=function(e){Invoca.PNAPI.pendingRequests=Invoca.PNAPI.pendingRequests.filter((function(t){return t!==e}))};function encodeUrlParams(e,t){var n=-1===e.search(/\?/)?"?":"&";for(var r in t)t.hasOwnProperty(r)&&(n+=encodeURIComponent(r)+"="+encodeURIComponent(t[r])+"&");return Object.keys(t).length?e+n:e}Invoca.JSON={parse:JSON.parse,stringify:stringifyJSON},Invoca.JSON.requestWithData=function(e,t,n,r,a){var o=encodeUrlParams(e,t);if(n){addRequest(o);var i=new XMLHttpRequest;i.overrideMimeType("application/json"),i.onload=function(){if(200===this.status)try{var e=JSON.parse(this.responseText);removeRequest(o),r&&r.collect("jsonRequestSucceeded","counter",{requireRoundTrip:!1}),a(e)}catch(e){s()}else s()},i.onerror=s,i.open("POST",o),i.send()}else Invoca.log("Invoca.JSON.requestWithData: JSON request with SSA disabled is not allowed",!0);function s(){var t="jsonRequestFailed."+(i.status?i.status:"unknown");r&&r.collect(t,"counter",{requireRoundTrip:!1}),warn("Request to "+e+" failed. Unable to replace numbers.")}},Invoca.JSONP=Invoca.JSONP||{},Invoca.JSONP.counter=0,Invoca.JSONP.requestWithData=function(e,t,n,r){var a="json_rr"+ ++Invoca.JSONP.counter;t.jsoncallback=a;var o=encodeUrlParams(e,t);return n&&addRequest(o),window[a]=function(e){removeRequest(o),r(e);try{delete window[a]}catch(e){}window[a]=null},Invoca.PNAPI.loadScript(o,(function(){this&&this.parentNode&&this.parentNode.removeChild(this)}),(function(){warn("Request to "+e+" failed. Unable to replace numbers.")})),a};var readAttribute=function(e,t){return e&&"object"===_typeof(e)&&e.getAttribute?e.getAttribute(t):null},cachedRootDomain;function readCookie(e){try{for(var t=document.cookie.split("; "),n=t.length-1;n>=0;n--){var r=t[n],a=r.indexOf("=");if(r.substring(0,a)===e)return r.substring(a+1)}return null}catch(e){Invoca.ExceptionHandling.notifyAndThrow(e,"Invoca.Tools.readCookie")}}function writeCookie(e,t,n,r){try{var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3);var o="expires="+a.toUTCString(),i="domain="+(r||"");document.cookie=e+"="+t+"; "+o+"; path=/; "+i}catch(e){Invoca.ExceptionHandling.notifyAndThrow(e,"writeCookie")}}function rootDomain(){if(void 0!==cachedRootDomain)return cachedRootDomain;for(var e=Invoca.domain.split("."),t=null,n="",r=e.length-1;r>=0;r--)try{if(writeCookie(n=".".concat(e[r]).concat(n),"1",1,n),readCookie(n)){t=n;break}}catch(e){}finally{n&&writeCookie(n,"",-1,n)}return cachedRootDomain=t}function setCookie(e,t,n){writeCookie(e,t,n,rootDomain())}function removeCookie(e){var t=Invoca.domain.split(".");if(t.length<=2)setCookie(e,"",-1);else for(var n=0;n tag misconfigured, ensure attributes are correct")}function clearRevision(){revision=null,removeCookie(REVISION_COOKIE_NAME)}function buildRevisionUrl(e,t){var n=window.InvocaCDNUrl||"//solutions.invocacdn.com";return"".concat(n,"/js/networks/").concat(e,"/tag-").concat(t,".js")}function _findInvocaScriptTag(){var e,t=document.getElementsByTagName("script");return Invoca.PNAPI.forEach(t,(function(t){readAttribute(t,Invoca._DOM.SCRIPT_TAG_ID_ATTR)&&(e=t)})),e}function _getExistingRevision(){var e=readCookie(REVISION_COOKIE_NAME);return"null"!==e&&e?(warn("You are testing revision ".concat(e)),e):"live"}function _handleSuccess(){loaded=!0,log("Successfully loaded revision ".concat(revision)),_updateCachedRevision(revision)}function _handleError(){warn('Revision "'.concat(revision,'" not found, proceeding with live version'));var e=buildRevisionUrl(tagId,revision="live");Invoca.PNAPI.loadScript(e,_handleSuccess,(function(){warn("Invoca: Client